<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

    <button onclick="alert('hello')">行内式</button>

    <script src="test.js">外部式</script>

    <button id="btn"> 点我一下</button>

    
    <button id="plus">+1</button>
    <div id="screen">0</div>

    <style>
        #screen{
            font-size: 30px;
            color: red;
        }
    </style>

    <script>
        //输入
        //var name = prompt("请输入姓名:");
       // var age = prompt("请输入年龄:");
        //var score = prompt("请输入分数");
        //alert("您的姓名是: " + name + "\n" + "您的年龄是: " + age + "\n" + "您的分数是: " +score + "\n");


        var arr = [];
        arr[2] = 10;
        console.log(arr)



        var bt = document.getElementById('btn');
        bt.onclick = function () {
            alert("hello world");
        }

        let plus = document.querySelector('#plus');
        plus.onclick = function () {
            let screen = document.querySelector('#screen');
            let val = screen.innerHTML;
            val = parseInt(val);
            val += 1;
            screen.innerHTML = val;
        }

    </script>


</body>

</html>